from pydantic_settings import BaseSettings
from os import getenv
from typing import Optional



class Settings(BaseSettings):
    # 数据库配置
    DATABASE_URL: Optional[str] = getenv("DATABASE_URL")
    # JWT配置
    SECRET_KEY: str = getenv("SECRET_KEY", "114514")
    ALGORITHM: str = getenv("ALGORITHM", "HS256")
    ACCESS_TOKEN_EXPIRE_MINUTES: int = 30

    PORT: Optional[str] = getenv("PORT")


settings = Settings()
